<?php
class P28nController extends AppController {
	var $name = 'P28n';
	var $uses = null;
	//var $components = array('P28n');
	function change($lang = null) {
		//debug($lang); die;
		//debug($_GET['lang']); die;
		if(isset($lang)){
			$this->P28n->change($lang);
		}else{
			if(isset($_REQUEST['lang'])){
				$this->P28n->change($_REQUEST['lang']);
			}
		}
		//debug($this->referer(null, true)); die;
		$this->redirect($this->referer(null, true));
	}
	function shuntRequest() {
		//debug($this->params['lang']); die;
		$this->P28n->change($this->params['lang']);
		$args = func_get_args();
		$this->redirect("/" . implode("/", $args));
	}
}
?>